package com.itheima.mapper;

import com.itheima.domain.Account;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AccountMapper {

    @Insert("insert into account values(#{id},#{name},#{money})")
    public void save(Account account);

    @Select("select * from account")
    @Results({
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(column = "money",property = "money"),
    })
    public List<Account> findAll();

}
